<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Test::Most - Most commonly needed test functions and features. - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Test-Most - MetaCPAN" href="https://metacpan.org/dist/Test-Most/releases.rss" />
        <link rel="canonical" href="./Test::Most.html" />
        <meta name="description" content="Most commonly needed test functions and features." />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Test::Most" />
<meta name="twitter:title"       content="Test::Most" />
<meta name="twitter:description" content="Most commonly needed test functions and features." />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Test::Most.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Test-Most was released.">
      <span class="relatize">24 Sep 2022 13:49:17 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Test-Most">Test-Most</a>
  </li>
  <li>
    Module version: 0.38
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Test-Most/source/lib/Test/Most.pm">Source</a>
    (<a href="https://metacpan.org/dist/Test-Most/source/lib/Test/Most.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Test-Most/source/lib/Test">Browse</a>
    (<a href="https://metacpan.org/dist/Test-Most/source/lib/Test?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Test-Most/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Test-Most/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/Ovid/test--most">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Most">Issues</a>
      (5)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Test-Most+0.38" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/T/Test-Most.html?oncpan=1&amp;distmat=1&amp;version=0.38&amp;grade=2" style="color: #090">3667</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/T/Test-Most.html?oncpan=1&amp;distmat=1&amp;version=0.38&amp;grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/T/Test-Most.html?oncpan=1&amp;distmat=1&amp;version=0.38&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/OVID/Test-Most-0.38">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Test-Most who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 2
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Test-Most-0.38/index.html">84.15% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Test-Most/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/O/OV/OVID/Test-Most-0.38.tar.gz">
      Download (<span itemprop="fileSize">15.79KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FOVID%2FTest-Most-0.38%2Flib%2FTest%2FMost.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Test-Most/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Test-Most/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Test-Most">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Test-Most">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Test/Most.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="OVID/Test-Most-0.38"
>0.38
  (OVID on 2022-09-24)</option>
<option
  
  value="OVID/Test-Most-0.37"
>0.37
  (OVID on 2020-04-04)</option>
<option
  
  value="OVID/Test-Most-0.36"
>0.36
  (OVID on 2020-04-04)</option>
<option
  
  value="OVID/Test-Most-0.35"
>0.35
  (OVID on 2016-08-11)</option>
<option
  
  value="OVID/Test-Most-0.34"
>0.34
  (OVID on 2014-08-03)</option>
<option
  
  value="OVID/Test-Most-0.33"
>0.33
  (OVID on 2014-01-12)</option>
<option
  
  value="OVID/Test-Most-0.32"
>0.32
  (OVID on 2014-01-12)</option>
<option
  
  value="OVID/Test-Most-0.31"
>0.31
  (OVID on 2012-09-06)</option>
<option
  
  value="OVID/Test-Most-0.30"
>0.30
  (OVID on 2012-09-05)</option>
<option
  
  value="OVID/Test-Most-0.25"
>0.25
  (OVID on 2011-08-17)</option>
<option
  
  value="OVID/Test-Most-0.24"
>0.24
  (OVID on 2011-06-18)</option>
<option
  
  value="OVID/Test-Most-0.23"
>0.23
  (OVID on 2010-09-08)</option>
<option
  
  value="OVID/Test-Most-0.22"
>0.22
  (OVID on 2010-08-07)</option>
<option
  
  value="OVID/Test-Most-0.21_04"
>0.21_04 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_03"
>0.21_03 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_02"
>0.21_02 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_01"
>0.21_01 DEV
  (OVID on 2009-02-18)</option>
<option
  
  value="OVID/Test-Most-0.21"
>0.21
  (OVID on 2009-02-18)</option>
<option
  
  value="OVID/Test-Most-0.20_02"
>0.20_02 DEV
  (OVID on 2008-11-27)</option>
<option
  
  value="OVID/Test-Most-0.20_01"
>0.20_01 DEV
  (OVID on 2008-11-25)</option>
<option
  
  value="OVID/Test-Most-0.20"
>0.20
  (OVID on 2008-11-06)</option>
<option
  
  value="OVID/Test-Most-0.12"
>0.12
  (OVID on 2008-10-15)</option>
<option
  
  value="OVID/Test-Most-0.11"
>0.11
  (OVID on 2008-07-29)</option>
<option
  
  value="OVID/Test-Most-0.10"
>0.10
  (OVID on 2008-07-22)</option>
<optgroup label="BackPAN">'
<option
  
  value="OVID/Test-Most-0.04"
>0.04
  (OVID on 2008-06-19)</option>
<option
  
  value="OVID/Test-Most-0.03"
>0.03
  (OVID on 2008-06-18)</option>
<option
  
  value="OVID/Test-Most-0.02"
>0.02
  (OVID on 2008-06-18)</option>
<option
  
  value="OVID/Test-Most-0.01"
>0.01
  (OVID on 2008-01-13)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/OVID/Test-Most-0.38/diff/' + encodeURIComponent(this.value) + '/lib/Test/Most.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="OVID/Test-Most-0.38"
>0.38
  (OVID on 2022-09-24)</option>
<option
  
  value="OVID/Test-Most-0.37"
>0.37
  (OVID on 2020-04-04)</option>
<option
  
  value="OVID/Test-Most-0.36"
>0.36
  (OVID on 2020-04-04)</option>
<option
  
  value="OVID/Test-Most-0.35"
>0.35
  (OVID on 2016-08-11)</option>
<option
  
  value="OVID/Test-Most-0.34"
>0.34
  (OVID on 2014-08-03)</option>
<option
  
  value="OVID/Test-Most-0.33"
>0.33
  (OVID on 2014-01-12)</option>
<option
  
  value="OVID/Test-Most-0.32"
>0.32
  (OVID on 2014-01-12)</option>
<option
  
  value="OVID/Test-Most-0.31"
>0.31
  (OVID on 2012-09-06)</option>
<option
  
  value="OVID/Test-Most-0.30"
>0.30
  (OVID on 2012-09-05)</option>
<option
  
  value="OVID/Test-Most-0.25"
>0.25
  (OVID on 2011-08-17)</option>
<option
  
  value="OVID/Test-Most-0.24"
>0.24
  (OVID on 2011-06-18)</option>
<option
  
  value="OVID/Test-Most-0.23"
>0.23
  (OVID on 2010-09-08)</option>
<option
  
  value="OVID/Test-Most-0.22"
>0.22
  (OVID on 2010-08-07)</option>
<option
  
  value="OVID/Test-Most-0.21_04"
>0.21_04 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_03"
>0.21_03 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_02"
>0.21_02 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_01"
>0.21_01 DEV
  (OVID on 2009-02-18)</option>
<option
  
  value="OVID/Test-Most-0.21"
>0.21
  (OVID on 2009-02-18)</option>
<option
  
  value="OVID/Test-Most-0.20_02"
>0.20_02 DEV
  (OVID on 2008-11-27)</option>
<option
  
  value="OVID/Test-Most-0.20_01"
>0.20_01 DEV
  (OVID on 2008-11-25)</option>
<option
  
  value="OVID/Test-Most-0.20"
>0.20
  (OVID on 2008-11-06)</option>
<option
  
  value="OVID/Test-Most-0.12"
>0.12
  (OVID on 2008-10-15)</option>
<option
  
  value="OVID/Test-Most-0.11"
>0.11
  (OVID on 2008-07-29)</option>
<option
  
  value="OVID/Test-Most-0.10"
>0.10
  (OVID on 2008-07-22)</option>
<optgroup label="BackPAN">'
<option
  
  value="OVID/Test-Most-0.04"
>0.04
  (OVID on 2008-06-19)</option>
<option
  
  value="OVID/Test-Most-0.03"
>0.03
  (OVID on 2008-06-18)</option>
<option
  
  value="OVID/Test-Most-0.02"
>0.02
  (OVID on 2008-06-18)</option>
<option
  
  value="OVID/Test-Most-0.01"
>0.01
  (OVID on 2008-01-13)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Exception::Class" title="Exception::Class" class="ellipsis">Exception::Class</a></li>
  <li><a href="./Test::Deep.html" title="Test::Deep" class="ellipsis">Test::Deep</a></li>
  <li><a href="./Test::Differences.html" title="Test::Differences" class="ellipsis">Test::Differences</a></li>
  <li><a href="./Test::Exception.html" title="Test::Exception" class="ellipsis">Test::Exception</a></li>
  <li><a href="https://metacpan.org/pod/Test::Harness" title="Test::Harness" class="ellipsis">Test::Harness</a></li>
  <li><a href="https://metacpan.org/pod/Test::More" title="Test::More" class="ellipsis">Test::More</a></li>
  <li><a href="https://metacpan.org/pod/Test::Warn" title="Test::Warn" class="ellipsis">Test::Warn</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Test::Most/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Test%3A%3AMost">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Test-Most">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/OVID/Test-Most-0.38/view/lib/Test/Most.pm">This version</a>
    </li>
    <li>
      <a href="./Test::Most.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/FIBO"><img src="https://www.gravatar.com/avatar/84833ca8026b345b452986b3bf24158e?d=identicon&amp;s=20" title="FIBO" alt="FIBO"></a>
<a class="display-all" href="https://metacpan.org/author/DBOEHMER"><img src="https://www.gravatar.com/avatar/220fbe10dba79664fe84771d5ea32763?d=identicon&amp;s=20" title="DBOEHMER" alt="DBOEHMER"></a>
<a class="display-all" href="https://metacpan.org/author/AYOUNG"><img src="https://www.gravatar.com/avatar/8d1e4946c288fbe87d1e0394f3e41b24?d=identicon&amp;s=20" title="AYOUNG" alt="AYOUNG"></a>
<a class="display-all" href="https://metacpan.org/author/JPINKHAM"><img src="https://www.gravatar.com/avatar/3bcc0652a89698d03598a4be5de4eabf?d=identicon&amp;s=20" title="JPINKHAM" alt="JPINKHAM"></a>
<a class="display-all" href="https://metacpan.org/author/KABLAMO"><img src="https://www.gravatar.com/avatar/6c59a99ff976dc69fe31f1fe3bf6dc01?d=identicon&amp;s=20" title="KABLAMO" alt="KABLAMO"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Test-Most/plussers">24 PAUSE users</a>
</div>
<div>
    14 non-PAUSE users
</div>
</div>
    </li>
    <li>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/OVID" class="author-name">Curtis &quot;Ovid&quot; Poe</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Test/Most.pm&#39;" class="">
<option
  selected
  value="OVID/Test-Most-0.38"
>0.38
  (OVID on 2022-09-24)</option>
<option
  
  value="OVID/Test-Most-0.37"
>0.37
  (OVID on 2020-04-04)</option>
<option
  
  value="OVID/Test-Most-0.36"
>0.36
  (OVID on 2020-04-04)</option>
<option
  
  value="OVID/Test-Most-0.35"
>0.35
  (OVID on 2016-08-11)</option>
<option
  
  value="OVID/Test-Most-0.34"
>0.34
  (OVID on 2014-08-03)</option>
<option
  
  value="OVID/Test-Most-0.33"
>0.33
  (OVID on 2014-01-12)</option>
<option
  
  value="OVID/Test-Most-0.32"
>0.32
  (OVID on 2014-01-12)</option>
<option
  
  value="OVID/Test-Most-0.31"
>0.31
  (OVID on 2012-09-06)</option>
<option
  
  value="OVID/Test-Most-0.30"
>0.30
  (OVID on 2012-09-05)</option>
<option
  
  value="OVID/Test-Most-0.25"
>0.25
  (OVID on 2011-08-17)</option>
<option
  
  value="OVID/Test-Most-0.24"
>0.24
  (OVID on 2011-06-18)</option>
<option
  
  value="OVID/Test-Most-0.23"
>0.23
  (OVID on 2010-09-08)</option>
<option
  
  value="OVID/Test-Most-0.22"
>0.22
  (OVID on 2010-08-07)</option>
<option
  
  value="OVID/Test-Most-0.21_04"
>0.21_04 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_03"
>0.21_03 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_02"
>0.21_02 DEV
  (OVID on 2010-02-06)</option>
<option
  
  value="OVID/Test-Most-0.21_01"
>0.21_01 DEV
  (OVID on 2009-02-18)</option>
<option
  
  value="OVID/Test-Most-0.21"
>0.21
  (OVID on 2009-02-18)</option>
<option
  
  value="OVID/Test-Most-0.20_02"
>0.20_02 DEV
  (OVID on 2008-11-27)</option>
<option
  
  value="OVID/Test-Most-0.20_01"
>0.20_01 DEV
  (OVID on 2008-11-25)</option>
<option
  
  value="OVID/Test-Most-0.20"
>0.20
  (OVID on 2008-11-06)</option>
<option
  
  value="OVID/Test-Most-0.12"
>0.12
  (OVID on 2008-10-15)</option>
<option
  
  value="OVID/Test-Most-0.11"
>0.11
  (OVID on 2008-07-29)</option>
<option
  
  value="OVID/Test-Most-0.10"
>0.10
  (OVID on 2008-07-22)</option>
<optgroup label="BackPAN">'
<option
  
  value="OVID/Test-Most-0.04"
>0.04
  (OVID on 2008-06-19)</option>
<option
  
  value="OVID/Test-Most-0.03"
>0.03
  (OVID on 2008-06-18)</option>
<option
  
  value="OVID/Test-Most-0.02"
>0.02
  (OVID on 2008-06-18)</option>
<option
  
  value="OVID/Test-Most-0.01"
>0.01
  (OVID on 2008-01-13)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Test-Most">Test-Most-0.38</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage four &#10;
          • 771 direct dependents &#10;          • 1705 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Test-Most-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Test-Most-0.38">
    <input type="hidden" name="author" value="OVID">
    <input type="hidden" name="distribution" value="Test-Most">
    <button type="submit" class="favorite highlight"><span>38</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Test::Most.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>38</span> ++</a>
</div>
   / <span>Test::Most</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Test::Most.html#NAME">NAME</a></li>
  <li><a href="./Test::Most.html#VERSION">VERSION</a></li>
  <li><a href="./Test::Most.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Test::Most.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Test::Most.html#EXPORT">EXPORT</a></li>
  <li><a href="./Test::Most.html#FUNCTIONS">FUNCTIONS</a>
    <ul>
      <li><a href="./Test::Most.html#die_on_fail">die_on_fail</a></li>
      <li><a href="./Test::Most.html#bail_on_fail">bail_on_fail</a></li>
      <li><a href="./Test::Most.html#restore_fail">restore_fail</a></li>
      <li><a href="./Test::Most.html#set_failure_handler">set_failure_handler</a></li>
      <li><a href="./Test::Most.html#explain">explain</a></li>
      <li><a href="./Test::Most.html#show">show</a></li>
      <li><a href="./Test::Most.html#always_explain-and-always_show">always_explain and always_show</a></li>
      <li><a href="./Test::Most.html#all_done">all_done</a></li>
    </ul>
  </li>
  <li><a href="./Test::Most.html#EXPORT-ON-DEMAND">EXPORT ON DEMAND</a>
    <ul>
      <li><a href="./Test::Most.html#timeit">timeit</a></li>
    </ul>
  </li>
  <li><a href="./Test::Most.html#DIE-OR-BAIL-ON-FAIL">DIE OR BAIL ON FAIL</a>
    <ul>
      <li><a href="./Test::Most.html#Import-list">Import list</a></li>
      <li><a href="./Test::Most.html#Functions">Functions</a></li>
      <li><a href="./Test::Most.html#Environment-variables">Environment variables</a></li>
    </ul>
  </li>
  <li><a href="./Test::Most.html#MISCELLANEOUS">MISCELLANEOUS</a>
    <ul>
      <li><a href="./Test::Most.html#Moose">Moose</a></li>
      <li><a href="./Test::Most.html#Excluding-Test-Modules">Excluding Test Modules</a></li>
      <li><a href="./Test::Most.html#Excluding-Test-Symbols">Excluding Test Symbols</a></li>
      <li><a href="./Test::Most.html#Deferred-plans">Deferred plans</a></li>
      <li><a href="./Test::Most.html#One-stop-shopping">One-stop shopping</a></li>
      <li><a href="./Test::Most.html#use-ok">use ok</a></li>
    </ul>
  </li>
  <li><a href="./Test::Most.html#RATIONALE">RATIONALE</a></li>
  <li><a href="./Test::Most.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./Test::Most.html#BUGS">BUGS</a></li>
  <li><a href="./Test::Most.html#SUPPORT">SUPPORT</a></li>
  <li><a href="./Test::Most.html#TODO">TODO</a>
    <ul>
      <li><a href="./Test::Most.html#Deferred-plans1">Deferred plans</a></li>
      <li><a href="./Test::Most.html#Cleaner-skip()">Cleaner skip()</a></li>
    </ul>
  </li>
  <li><a href="./Test::Most.html#CAVEATS">CAVEATS</a></li>
  <li><a href="./Test::Most.html#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</a></li>
  <li><a href="./Test::Most.html#COPYRIGHT-&amp;-LICENSE">COPYRIGHT &amp; LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Test::Most - Most commonly needed test functions and features.</p>

<h1 id="VERSION">VERSION</h1>

<p>Version 0.38</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<p>Instead of this:</p>

<pre><code>    use strict;
    use warnings;
    use Test::Exception 0.88;
    use Test::Differences 0.500;
    use Test::Deep 0.106;
    use Test::Warn 0.11;
    use Test::More tests =&gt; 42;</code></pre>

<p>You type this:</p>

<pre><code>    use Test::Most tests =&gt; 42;</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p><a href="./Test::Most.html">Test::Most</a> exists to reduce boilerplate and to make your testing life easier. We provide &quot;one stop shopping&quot; for most commonly used testing modules. In fact, we often require the latest versions so that you get bug fixes through <a href="./Test::Most.html">Test::Most</a> and don&#39;t have to keep upgrading these modules separately.</p>

<p>This module provides you with the most commonly used testing functions, along with automatically turning on strict and warning and gives you a bit more fine-grained control over your test suite.</p>

<pre><code>    use Test::Most tests =&gt; 4, &#39;die&#39;;

    ok 1, &#39;Normal calls to ok() should succeed&#39;;
    is 2, 2, &#39;... as should all passing tests&#39;;
    eq_or_diff [3], [4], &#39;... but failing tests should die&#39;;
    ok 4, &#39;... will never get to here&#39;;</code></pre>

<p>As you can see, the <code>eq_or_diff</code> test will fail. Because &#39;die&#39; is in the import list, the test program will halt at that point.</p>

<p>If you do not want strict and warnings enabled, you must explicitly disable them. Thus, you must be explicit about what you want and no longer need to worry about accidentally forgetting them.</p>

<pre><code>    use Test::Most tests =&gt; 4;
    no strict;
    no warnings;</code></pre>

<h1 id="EXPORT">EXPORT</h1>

<p>All functions from the following modules will automatically be exported into your namespace:</p>

<ul>

<li><p><a href="https://metacpan.org/pod/Test::More">Test::More</a></p>

</li>
<li><p><a href="./Test::Exception.html">Test::Exception</a></p>

</li>
<li><p><a href="./Test::Differences.html">Test::Differences</a></p>

</li>
<li><p><a href="./Test::Deep.html">Test::Deep</a></p>

</li>
<li><p><a href="https://metacpan.org/pod/Test::Warn">Test::Warn</a></p>

</li>
</ul>

<p>Functions which are <i>optionally</i> exported from any of those modules must be referred to by their fully-qualified name:</p>

<pre><code>  Test::Deep::render_stack( $var, $stack );</code></pre>

<h1 id="FUNCTIONS">FUNCTIONS</h1>

<p>Several other functions are also automatically exported:</p>

<h2 id="die_on_fail"><code>die_on_fail</code></h2>

<pre><code> die_on_fail;
 is_deeply $foo, bar, &#39;... we throw an exception if this fails&#39;;</code></pre>

<p>This function, if called, will cause the test program to throw a <a href="https://metacpan.org/pod/Test::Most::Exception">Test::Most::Exception</a>, effectively halting the test.</p>

<h2 id="bail_on_fail"><code>bail_on_fail</code></h2>

<pre><code> bail_on_fail;
 is_deeply $foo, bar, &#39;... we bail out if this fails&#39;;</code></pre>

<p>This function, if called, will cause the test suite to BAIL_OUT() if any tests fail after it.</p>

<h2 id="restore_fail"><code>restore_fail</code></h2>

<pre><code> die_on_fail;
 is_deeply $foo, bar, &#39;... we throw an exception if this fails&#39;;

 restore_fail;
 cmp_bag(\@got, \@bag, &#39;... we will not throw an exception if this fails&#39;;</code></pre>

<p>This restores the original test failure behavior, so subsequent tests will no longer throw an exception or BAIL_OUT().</p>

<h2 id="set_failure_handler"><code>set_failure_handler</code></h2>

<p>If you prefer other behavior to &#39;die_on_fail&#39; or &#39;bail_on_fail&#39;, you can set your own failure handler:</p>

<pre><code> set_failure_handler( sub {
     my $builder = shift;
     if ( $builder &amp;&amp; $builder-&gt;{Test_Results}[-1] =~ /critical/ ) {
        send_admin_email(&quot;critical failure in tests&quot;);
     }
 } );</code></pre>

<p>It receives the <code>Test::Builder</code> instance as its only argument.</p>

<p><b>Important</b>: Note that if the failing test is the very last test run, then the <code>$builder</code> will likely be undefined. This is an unfortunate side effect of how <code>Test::Builder</code> has been designed.</p>

<h2 id="explain"><code>explain</code></h2>

<p>Similar to <code>note()</code>, the output will only be seen by the user by using the <code>-v</code> switch with <code>prove</code> or reading the raw TAP.</p>

<p>Unlike <code>note()</code>, any reference in the argument list is automatically expanded using <code>Data::Dumper</code>. Thus, instead of this:</p>

<pre><code> my $self = Some::Object-&gt;new($id);
 use Data::Dumper;
 explain &#39;I was just created&#39;, Dumper($self);</code></pre>

<p>You can now just do this:</p>

<pre><code> my $self = Some::Object-&gt;new($id);
 explain &#39;I was just created:  &#39;, $self;</code></pre>

<p>That output will look similar to:</p>

<pre><code> I was just created: bless( {
   &#39;id&#39; =&gt; 2,
   &#39;stack&#39; =&gt; []
 }, &#39;Some::Object&#39; )</code></pre>

<p>Note that the &quot;dumpered&quot; output has the <code>Data::Dumper</code> variables <code>$Indent</code>, <code>Sortkeys</code> and <code>Terse</code> all set to the value of <code>1</code> (one). This allows for a much cleaner diagnostic output and at the present time cannot be overridden.</p>

<p>Note that Test::More&#39;s <code>explain</code> acts differently. This <code>explain</code> is equivalent to <code>note explain</code> in Test::More.</p>

<h2 id="show"><code>show</code></h2>

<p>Experimental. Just like <code>explain</code>, but also tries to show you the lexical variable names:</p>

<pre><code> my $var   = 3;
 my @array = qw/ foo bar /;
 show $var, \@array;
 __END__
 $var = 3;
 @array = [
     &#39;foo&#39;,
     &#39;bar&#39;
 ];</code></pre>

<p>It will show <code>$VAR1</code>, <code>$VAR2</code> ... <code>$VAR_N</code> for every variable it cannot figure out the variable name to:</p>

<pre><code> my @array = qw/ foo bar /;
 show @array;
 __END__
 $VAR1 = &#39;foo&#39;;
 $VAR2 = &#39;bar&#39;;</code></pre>

<p>Note that this relies on <a href="https://metacpan.org/pod/Data::Dumper::Names">Data::Dumper::Names</a> version 0.03 or greater. If this is not present, it will warn and call <a href="https://metacpan.org/pod/explain">explain</a> instead. Also, it can only show the names for lexical variables. Globals such as <code>%ENV</code> or <code>%@</code> are not accessed via PadWalker and thus cannot be shown. It would be nice to find a workaround for this.</p>

<h2 id="always_explain-and-always_show"><a id="always_explain"></a><code>always_explain</code> and <code>always_show</code></h2>

<p>These are identical to <code>explain</code> and <code>show</code>, but like <a href="https://metacpan.org/pod/Test::More">Test::More</a>&#39;s <code>diag</code> function, these will always emit output, regardless of whether or not you&#39;re in verbose mode.</p>

<h2 id="all_done"><code>all_done</code></h2>

<p><b>DEPRECATED</b>. Use the new <code>done_testing()</code> (added in <a href="https://metacpan.org/pod/Test::More">Test::More</a> since 0.87_01). Instead. We&#39;re leaving this in here for a long deprecation cycle. After a while, we might even start warning.</p>

<p>If the plan is specified as <code>defer_plan</code>, you may call <code>&amp;all_done</code> at the end of the test with an optional test number. This lets you set the plan without knowing the plan before you run the tests.</p>

<p>If you call it without a test number, the tests will still fail if you don&#39;t get to the end of the test. This is useful if you don&#39;t want to specify a plan but the tests exit unexpectedly. For example, the following would <i>pass</i> with <code>no_plan</code> but fails with <code>all_done</code>.</p>

<pre><code> use Test::More &#39;defer_plan&#39;;
 ok 1;
 exit;
 ok 2;
 all_done;</code></pre>

<p>See <a href="./Test::Most.html#Deferred-plans">&quot;Deferred plans&quot;</a> for more information.</p>

<h1 id="EXPORT-ON-DEMAND"><a id="EXPORT1"></a>EXPORT ON DEMAND</h1>

<p>The following will be exported only if requested:</p>

<h2 id="timeit"><code>timeit</code></h2>

<p>Prototype: <code>timeit(&amp;;$)</code></p>

<p>This function will warn if <code>Time::HiRes</code> is not installed. The test will still be run, but no timing information will be displayed.</p>

<pre><code> use Test::Most &#39;timeit&#39;;
 timeit { is expensive_function(), $some_value, $message }
    &quot;expensive_function()&quot;;
 timeit { is expensive_function(), $some_value, $message };</code></pre>

<p><code>timeit</code> accepts a code reference and an optional message. After the test is run, will <code>explain</code> the time of the function using <code>Time::HiRes</code>. If a message is supplied, it will be formatted as:</p>

<pre><code>  sprintf &quot;$message: took %s seconds&quot; =&gt; $time;</code></pre>

<p>Otherwise, it will be formatted as:</p>

<pre><code>  sprintf &quot;$filename line $line: took %s seconds&quot; =&gt; $time;</code></pre>

<h1 id="DIE-OR-BAIL-ON-FAIL"><a id="DIE"></a>DIE OR BAIL ON FAIL</h1>

<p>Sometimes you want your test suite to throw an exception or BAIL_OUT() if a test fails. In order to provide maximum flexibility, there are three ways to accomplish each of these.</p>

<h2 id="Import-list"><a id="Import"></a>Import list</h2>

<pre><code> use Test::Most &#39;die&#39;, tests =&gt; 7;
 use Test::Most qw&lt; no_plan bail &gt;;</code></pre>

<p>If <code>die</code> or <code>bail</code> is anywhere in the import list, the test program/suite will throw a <code>Test::Most::Exception</code> or <code>BAIL_OUT()</code> as appropriate the first time a test fails. Calling <code>restore_fail</code> anywhere in the test program will restore the original behavior (not throwing an exception or bailing out).</p>

<h2 id="Functions">Functions</h2>

<pre><code> use Test::Most &#39;no_plan&#39;;
 ok $bar, &#39;The test suite will continue if this passes&#39;;

 die_on_fail;
 is_deeply $foo, bar, &#39;... we throw an exception if this fails&#39;;

 restore_fail;
 ok $baz, &#39;The test suite will continue if this passes&#39;;</code></pre>

<p>The <code>die_on_fail</code> and <code>bail_on_fail</code> functions will automatically set the desired behavior at runtime.</p>

<h2 id="Environment-variables"><a id="Environment"></a>Environment variables</h2>

<pre><code> DIE_ON_FAIL=1 prove t/
 BAIL_ON_FAIL=1 prove t/</code></pre>

<p>If the <code>DIE_ON_FAIL</code> or <code>BAIL_ON_FAIL</code> environment variables are true, any tests which use <code>Test::Most</code> will throw an exception or call BAIL_OUT on test failure.</p>

<h1 id="MISCELLANEOUS">MISCELLANEOUS</h1>

<h2 id="Moose">Moose</h2>

<p>It used to be that this module would produce a warning when used with Moose:</p>

<pre><code>    Prototype mismatch: sub main::blessed ($) vs none</code></pre>

<p>This was because <a href="./Test::Deep.html">Test::Deep</a> exported a <code>blessed()</code> function by default, but its prototype did not match the <a href="Moose.html">Moose</a> version&#39;s prototype. We now exclude the <a href="./Test::Deep.html">Test::Deep</a> version by default. If you need it, you can call the fully-qualified version or request it on the command line:</p>

<pre><code>    use Test::Most &#39;blessed&#39;;</code></pre>

<p>Note that as of version <code>0.34</code>, <code>reftype</code> is also excluded from <code>Test::Deep</code>&#39;s import list. This was causing issues with people trying to use <code>Scalar::Util</code>&#39;s <code>reftype</code> function.</p>

<h2 id="Excluding-Test-Modules"><a id="Excluding"></a>Excluding Test Modules</h2>

<p>Sometimes you want a exclude a particular test module. For example, <a href="./Test::Deep.html">Test::Deep</a>, when used with <a href="Moose.html">Moose</a>, produces the following warning:</p>

<pre><code>    Prototype mismatch: sub main::blessed ($) vs none</code></pre>

<p>You can exclude this with by adding the module to the import list with a &#39;-&#39; symbol in front:</p>

<pre><code>    use Test::Most tests =&gt; 42, &#39;-Test::Deep&#39;;</code></pre>

<p>See <a href="https://rt.cpan.org/Ticket/Display.html?id=54362&amp;results=e73ff63c5bf9ba0f796efdba5773cf3f">https://rt.cpan.org/Ticket/Display.html?id=54362&amp;results=e73ff63c5bf9ba0f796efdba5773cf3f</a> for more information.</p>

<h2 id="Excluding-Test-Symbols"><a id="Excluding1"></a>Excluding Test Symbols</h2>

<p>Sometimes you don&#39;t want to exclude an entire test module, but just a particular symbol that is causing issues You can exclude the symbol(s) in the standard way, by specifying the symbol in the import list with a &#39;!&#39; in front:</p>

<pre><code>    use Test::Most tests =&gt; 42, &#39;!throws_ok&#39;;</code></pre>

<h2 id="Deferred-plans"><a id="Deferred"></a>Deferred plans</h2>

<p><b>DEPRECATED</b> and will be removed in some future release of this module. Using <code>defer_plan</code> will <code>carp()</code>. Use <code>done_testing()</code> from <a href="https://metacpan.org/pod/Test::More">Test::More</a> instead.</p>

<pre><code> use Test::Most qw&lt;defer_plan&gt;;
 use My::Tests;
 my $test_count = My::Tests-&gt;run;
 all_done($test_count);</code></pre>

<p>Sometimes it&#39;s difficult to know the plan up front, but you can calculate the plan as your tests run. As a result, you want to defer the plan until the end of the test. Typically, the best you can do is this:</p>

<pre><code> use Test::More &#39;no_plan&#39;;
 use My::Tests;
 My::Tests-&gt;run;</code></pre>

<p>But when you do that, <code>Test::Builder</code> merely asserts that the number of tests you <i>ran</i> is the number of tests. Until now, there was no way of asserting that the number of tests you <i>expected</i> is the number of tests unless you do so before any tests have run. This fixes that problem.</p>

<h2 id="One-stop-shopping"><a id="One"></a>One-stop shopping</h2>

<p>We generally require the latest stable versions of various test modules. Why? Because they have bug fixes and new features. You don&#39;t want to have to keep remembering them, so periodically we&#39;ll release new versions of <a href="./Test::Most.html">Test::Most</a> just for bug fixes.</p>

<h2 id="use-ok"><a id="use"></a><code>use ok</code></h2>

<p>We do not bundle <a href="https://metacpan.org/pod/Test::use::ok">Test::use::ok</a>, though it&#39;s been requested. That&#39;s because <code>use_ok</code> is broken, but <a href="https://metacpan.org/pod/Test::use::ok">Test::use::ok</a> is also subtly broken (and a touch harder to fix). See <a href="http://use.perl.org/~Ovid/journal/39859">http://use.perl.org/~Ovid/journal/39859</a> for more information.</p>

<p>If you want to test if you can use a module, just use it. If it fails, the test will still fail and that&#39;s the desired result.</p>

<h1 id="RATIONALE">RATIONALE</h1>

<p>People want more control over their test suites. Sometimes when you see hundreds of tests failing and whizzing by, you want the test suite to simply halt on the first failure. This module gives you that control.</p>

<p>As for the reasons for the four test modules chosen, I ran code over a local copy of the CPAN to find the most commonly used testing modules. Here&#39;s the top twenty as of January 2010 (the numbers are different because we&#39;re now counting distributions which use a given module rather than simply the number of times a module is used).</p>

<pre><code>    1   Test::More                          14111
    2   Test                                 1736
    3   Test::Exception                       744
    4   Test::Simple                          331
    5   Test::Pod                             328
    6   Test::Pod::Coverage                   274
    7   Test::Perl::Critic                    248
    8   Test::Base                            228
    9   Test::NoWarnings                      155
    10  Test::Distribution                    142
    11  Test::Kwalitee                        138
    12  Test::Deep                            128
    13  Test::Warn                            127
    14  Test::Differences                     102
    15  Test::Spelling                        101
    16  Test::MockObject                       87
    17  Test::Builder::Tester                  84
    18  Test::WWW::Mechanize::Catalyst         79
    19  Test::UseAllModules                    63
    20  Test::YAML::Meta                       61</code></pre>

<p><a href="./Test::Most.html">Test::Most</a> is number 24 on that list, if you&#39;re curious. See <a href="http://blogs.perl.org/users/ovid/2010/01/most-popular-testing-modules---january-2010.html">http://blogs.perl.org/users/ovid/2010/01/most-popular-testing-modules---january-2010.html</a>.</p>

<p>The modules chosen seemed the best fit for what <code>Test::Most</code> is trying to do. As of 0.02, we&#39;ve added <a href="https://metacpan.org/pod/Test::Warn">Test::Warn</a> by request. It&#39;s not in the top ten, but it&#39;s a great and useful module.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Curtis Poe, <code>&lt;ovid at cpan.org&gt;</code></p>

<h1 id="BUGS">BUGS</h1>

<p>Please report any bugs or feature requests to <code>bug-test-extended at rt.cpan.org</code>, or through the web interface at <a href="http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Most">http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Most</a>. I will be notified, and then you&#39;ll automatically be notified of progress on your bug as I make changes.</p>

<h1 id="SUPPORT">SUPPORT</h1>

<p>You can find documentation for this module with the perldoc command.</p>

<pre><code>    perldoc Test::Most</code></pre>

<p>You can also look for information at:</p>

<ul>

<li><p>RT: CPAN&#39;s request tracker</p>

<p><a href="http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Most">http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Most</a></p>

</li>
<li><p>AnnoCPAN: Annotated CPAN documentation</p>

<p><a href="http://annocpan.org/dist/Test-Most">http://annocpan.org/dist/Test-Most</a></p>

</li>
<li><p>CPAN Ratings</p>

<p><a href="http://cpanratings.perl.org/d/Test-Most">http://cpanratings.perl.org/d/Test-Most</a></p>

</li>
<li><p>Search CPAN</p>

<p><a href="http://search.cpan.org/dist/Test-Most">http://search.cpan.org/dist/Test-Most</a></p>

</li>
</ul>

<h1 id="TODO">TODO</h1>

<h2 id="Deferred-plans1"><a id="Deferred1"></a>Deferred plans</h2>

<p>Sometimes you don&#39;t know the number of tests you will run when you use <code>Test::More</code>. The <code>plan()</code> function allows you to delay specifying the plan, but you must still call it before the tests are run. This is an error:</p>

<pre><code> use Test::More;

 my $tests = 0;
 foreach my $test (
     my $count = run($test); # assumes tests are being run
     $tests += $count;
 }
 plan($tests);</code></pre>

<p>The way around this is typically to use &#39;no_plan&#39; and when the tests are done, <code>Test::Builder</code> merely sets the plan to the number of tests run. We&#39;d like for the programmer to specify this number instead of letting <code>Test::Builder</code> do it. However, <code>Test::Builder</code> internals are a bit difficult to work with, so we&#39;re delaying this feature.</p>

<h2 id="Cleaner-skip()"><a id="Cleaner"></a><a id="Cleaner-skip"></a>Cleaner skip()</h2>

<pre><code> if ( $some_condition ) {
     skip $message, $num_tests;
 }
 else {
     # run those tests
 }</code></pre>

<p>That would be cleaner and I might add it if enough people want it.</p>

<h1 id="CAVEATS">CAVEATS</h1>

<p>Because of how Perl handles arguments, and because diagnostics are not really part of the Test Anything Protocol, what actually happens internally is that we note that a test has failed and we throw an exception or bail out as soon as the <i>next</i> test is called (but before it runs). This means that its arguments are automatically evaluated before we can take action:</p>

<pre><code> use Test::Most qw&lt;no_plan die&gt;;

 ok $foo, &#39;Die if this fails&#39;;
 ok factorial(123456),
   &#39;... but wait a loooong time before you throw an exception&#39;;</code></pre>

<h1 id="ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</h1>

<p>Many thanks to <code>perl-qa</code> for arguing about this so much that I just went ahead and did it :)</p>

<p>Thanks to Aristotle for suggesting a better way to die or bailout.</p>

<p>Thanks to &#39;swillert&#39; (<a href="http://use.perl.org/~swillert/">http://use.perl.org/~swillert/</a>) for suggesting a better implementation of my &quot;dumper explain&quot; idea (<a href="http://use.perl.org/~Ovid/journal/37004">http://use.perl.org/~Ovid/journal/37004</a>).</p>

<h1 id="COPYRIGHT-&amp;-LICENSE"><a id="COPYRIGHT"></a><a id="COPYRIGHT---LICENSE"></a>COPYRIGHT &amp; LICENSE</h1>

<p>Copyright 2008 Curtis Poe, all rights reserved.</p>

<p>This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Test::Most, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Test::Most</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Test::Most</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Test::Most.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
